var SysUserTabStateChangeDatagrid = new HgUi.Datagrid("SysUserTabStateChange_datagrid");
SysUserTabStateChangeDatagrid.toolbar = $("#SysUserTabStateChange_toolbar");
SysUserTabStateChangeDatagrid.options.tipCells 
	= ["lockType","ip","originState","currentState","recordType","descr"];
SysUserTabStateChangeDatagrid.init();
SysUserTabStateChangeDatagrid.grid.datagrid("enableFilter",[
	{
		field: 'type',
		type: 'combobox',
		options: {
			panelHeight:'auto',
			editable:false,
			prompt: '---请选择---',
			data:HgUtil.getDictComboboxData('sysUserStateChangeType'),
			onChange: function(value) {
				if (value == ''){
					SysUserTabStateChangeDatagrid.grid.datagrid('removeFilterRule', 'type');
				}
				else{
					SysUserTabStateChangeDatagrid.grid.datagrid('addFilterRule', {
						field: 'type',
						op: 'equal',
						value: value
					});
				}
				SysUserTabStateChangeDatagrid.grid.datagrid('doFilter');
			}
		}
	},                                                        
	{
		field: 'originState',
		type: 'combobox',
		options: {
			panelHeight:'auto',
			editable:false,
			prompt: '---请选择---',
			data:HgUtil.getDictComboboxData('userStateType'),
			onChange: function(value) {
				if (value == ''){
					SysUserTabStateChangeDatagrid.grid.datagrid('removeFilterRule', 'originState');
				}
				else{
					SysUserTabStateChangeDatagrid.grid.datagrid('addFilterRule', {
						field: 'originState',
						op: 'equal',
						value: value
					});
				}
				SysUserTabStateChangeDatagrid.grid.datagrid('doFilter');
			}
		}
	},
	{
		field: 'currentState',
		type: 'combobox',
		options: {
			panelHeight:'auto',
			editable:false,
			prompt: '---请选择---',
			data:HgUtil.getDictComboboxData('userStateType'),
			onChange: function(value) {
				if (value == ''){
					SysUserTabStateChangeDatagrid.grid.datagrid('removeFilterRule', 'currentState');
				}
				else{
					SysUserTabStateChangeDatagrid.grid.datagrid('addFilterRule', {
						field: 'currentState',
						op: 'equal',
						value: value
					});
				}
				SysUserTabStateChangeDatagrid.grid.datagrid('doFilter');
			}
		}
	},
	{
		field: 'crtType',
		type: 'combobox',
		options: {
			panelHeight:'auto',
			editable:false,
			prompt: '---请选择---',
			data:HgUtil.getDictComboboxData('crtTypeUserStateChange'),
			onChange: function(value) {
				if (value == ''){
					SysUserTabStateChangeDatagrid.grid.datagrid('removeFilterRule', 'crtType');
				}
				else{
					SysUserTabStateChangeDatagrid.grid.datagrid('addFilterRule', {
						field: 'crtType',
						op: 'equal',
						value: value
					});
				}
				SysUserTabStateChangeDatagrid.grid.datagrid('doFilter');
			}
		}
	},
	{
		field: 'isCurrent',
		type: 'combobox',
		options: {
			panelHeight:'auto',
			editable:false,
			prompt: '---请选择---',
			data:HgUtil.getDictComboboxData('trueOrFalse'),
			onChange: function(value) {
				if (value == ''){
					SysUserTabStateChangeDatagrid.grid.datagrid('removeFilterRule', 'isCurrent');
				}
				else{
					SysUserTabStateChangeDatagrid.grid.datagrid('addFilterRule', {
						field: 'isCurrent',
						op: 'equal',
						value: value
					});
				}
				SysUserTabStateChangeDatagrid.grid.datagrid('doFilter');
			}
		}
	}
]);
SysUserTabStateChangeDatagrid.bindDefaultToolbarEvent();

// 清空查询---------------------------------------------------------------------------------------------------
SysUserTabStateChangeDatagrid.toolbar.find("[tag=clear]").click(function() {
    SysUserTabStateChangeDatagrid.grid.datagrid("removeFilterRule");
    SysUserTabStateChangeDatagrid.grid.datagrid("load", {});
});
